﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SlimDX;

namespace System.Windows.Media.Media3D10
{
    /// <summary>
    /// Classe helper pour les vecteurs
    /// </summary>
    public static class VectorHelper
    {
        /// <summary>
        /// Transforme un <see cref="SlimDX.Vector4"/> en <see cref="SlimDX.Vector3"/>.
        /// </summary>
        /// <param name="vector"><see cref="SlimDX.Vector4"/> à transformer.</param>
        /// <returns><see cref="SlimDX.Vector4"/> transformé.</returns>
        public static Vector3 ToVector3(this Vector4 vector)
        {
            return new Vector3(vector.X, vector.Y, vector.Z);
        }

        /// <summary>
        /// Transforme un <see cref="SlimDX.Vector4"/> en <see cref="SlimDX.Vector3"/>.
        /// </summary>
        /// <param name="vector"><see cref="SlimDX.Vector3"/> à transformer.</param>
        /// <returns><see cref="SlimDX.Vector3"/> transformé.</returns>
        public static Vector4 ToVector4(this Vector3 vector)
        {
            return ToVector4(vector, 0.0f);
        }

        /// <summary>
        /// Transforme un <see cref="SlimDX.Vector4"/> en <see cref="SlimDX.Vector3"/>.
        /// </summary>
        /// <param name="vector"><see cref="SlimDX.Vector3"/> à transformer.</param>
        /// <param name="wValue">Composante w du <see cref="SlimDX.Vector4"/></param>
        /// <returns><see cref="SlimDX.Vector3"/> transformé.</returns>
        public static Vector4 ToVector4(this Vector3 vector, float wValue)
        {
            return new Vector4(vector, wValue);
        }
    }
}
